<ui:composition
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:q="http://huliqing.name/qfaces"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    template="/WEB-INF/template/layout_system.xhtml">

    <ui:define name="subTabName">
        <c:set var="subTabName" value="helpList" />
    </ui:define>

    <ui:define name="menuTitle">
        <img src="/_res/image/star.png" height="40" class="alignM" alt=""/>
        <q:saveState value="#{helpEditWe.helpEn}" />
        <h:outputText value="#{helpEditWe.helpEn.helpId != null ? 'Edit Help' : 'Add Help'}" />
    </ui:define>

    <ui:define name="menuContent">
        <style type="text/css">
            .col1{width:80px;text-align:center;}
        </style>
        <h:form id="myform">
            <h:panelGrid columns="2" border="0"
                         width="100%"
                         columnClasses="col1,,"
                         rowClasses="row2,row1"
                         headerClass="header alignL"
                         cellpadding="3"
                         cellspacing="3">
                <f:facet name="header">
                    <h:outputText value="#{helpEditWe.helpEn.helpId != null ? 'Edit Help' : 'Add Help'}" />
                </f:facet>
                <h:outputLabel for="helpId" value="Help ID" />
                <h:panelGroup>
                    <h:inputText id="helpId" value="#{helpEditWe.helpEn.helpId}" disabled="#{helpEditWe.helpEn.helpId != null}" />
                    <q:validator for="helpId" required="true" messageError="ID Required" displayFlag="false" />
                </h:panelGroup>

                <h:outputText value="Description" />
                <h:panelGroup>
                    <h:inputText id="des" value="#{helpEditWe.helpEn.des}" style="width:99%;"/>
                    <q:validator for="des" required="true" messageError="Description Required" displayFlag="false" />
                </h:panelGroup>

                <h:outputText value="Content" />
                <q:editor value="#{helpEditWe.helpEn.content}" style="width:100%;">
                    <f:converter converterId="converter.TextConverter" />
                </q:editor>

                <h:panelGroup />
                <h:commandButton value="Submit" action="#{helpEditWe.saveOrUpdate}" styleClass="button"/>
            </h:panelGrid>
        </h:form>
        <script type="text/javascript">
            document.getElementById("myform:helpId").focus();
        </script>
    </ui:define>
</ui:composition>